package com.web.dao.impl;

import com.web.dao.UserDao;
import com.web.entity.User;
import com.web.util.JDBCUtils;

import java.util.List;

//用户数据访问接口实现
public class UserDaoImpl implements UserDao {

    @Override
    public User selectUserByname(String username) {
        List<User> users =  JDBCUtils.query(User.class,"select * from t_user where username=?",username);
        if (users.size() > 0){
            return  users.get(0);
        }
        return null;
    }




}
